﻿<html> 
	<center>
    <form action="MAY_IN.php"method=POST>
    <b><h2>MỜI BẠN NHẬP THÔNG TIN MÁY IN</h2></b>
    
    <table>
			TRỌNG LƯỢNG MÁY:
            <input type="text"size="30"name="trongluongmay">
			<br>
			NĂM SẢN XUẤT:
            <input type="text"size="30"name="namsanxuat">
			<br>
			HÃNG SẢN XUẤT:
            <input type="text"size="30"name="hangsanxuat">
			<br>
			SỐ KIM:
            <input type="year"size="30"name="sokim">
			<br>
			TỐC ĐỘ QUAY MÁY IN KIM:
            <input type="year"size="30"name="tocdoquaymayinkim">
			<br>
			ĐỘ PHÂN GIẢI MÁY IN LASER:
            <input type="year"size="30"name="dophangiai">
			<br>
			TỐC ĐỘ QUAY MÁY IN LASER:
            <input type="year"size="30"name="tocdoquaymayinlaser">
			<br>
            <input type=submit value="GỞI" name ="MAY_IN.php">
            <input type=reset value="NHẬP LẠI">
			</center>
    </table>
    </form>

</html>
<?php
    CLASS MAYIN
    {
        public $tlmay;
        public $namsx;
        public $hangsx;
    FUNCTION nhap($tlmay,$namsx,$hangsx)
        {
            $this->tlmay=$tlmay;
            $this->namsx=$namsx;
            $this->hangsx=$hangsx;
        }
    FUNCTION xuat()
        {
            echo $this->tlmay;
            echo "<br>";
            echo $this->namsx;
            echo "<br>";
            echo $this->hangsx;
            echo "<br>";
        }
    }
    CLASS MAYINKIM EXTENDS MAYIN
    {
        public $sokim;
        public $tocdo_quay;
    FUNCTION NHAP_MAYINKIM($tlmay,$namsx,$hangsx,$sokim,$tocdo_quay)
        {
            $this->NHAP($tlmay,$namsx,$hangsx);
            $this->sokim=$sokim;
            $this->tocdo_quay=$tocdo_quay;
        }
    FUNCTION XUAT_MAYINKIM()
        {
            echo $this->XUAT();
            echo $this->sokim;
            echo "<br>";
            echo $this->tocdo_quay;
            echo "<br>"; 
        }
    }
    CLASS MAYIN_LASER EXTENDS MAYIN
    {
        public $DO_PG;
        public $tocdo_quay_mayin_laser;
    FUNCTION NHAP_MAYIN_LASER($tlmay,$namsx,$hangsx,$DO_PG,$tocdo_quay_mayin_laser)
        {
            $this->NHAP($tlmay,$namsx,$hangsx);
            $this->DO_PG=$DO_PG;
            $this->tocdo_quay_mayin_laser=$tocdo_quay_mayin_laser;
        }
    FUNCTION XUAT_MAYIN_LASER()
        {
            echo $this->XUAT();
            echo $this->DO_PG;
            echo "<br>";
            echo $this->tocdo_quay_mayin_laser;
            echo "<br>"; 
        }
    }
    $a=$_POST['trongluongmay']; 
    $b=$_POST['namsanxuat'];
    $c=$_POST['hangsanxuat'];
    $d=$_POST['sokim'];
    $e=$_POST['tocdoquaymayinkim'];
    $f=$_POST['dophangiai'];
    $h=$_POST['tocdoquaymayinlaser'];
    $d=(int)$d;
    $e=(int)$e;
    $f=(int)$f;
    $h=(int)$h;
    echo "MÁY IN KIM";
    echo "<br>";
    $in_kim=new MAYINKIM();
    $in_kim->NHAP_MAYINKIM("$a","$b","$c","$d","$e");
    $in_kim->XUAT_MAYINKIM();
    echo "MÁY IN LASER";
    echo "<br>";
    $in_laser=new MAYIN_LASER();
    $in_laser->NHAP_MAYIN_LASER("$a","$b","$c","$f","$h");
    $in_laser->XUAT_MAYIN_LASER();
?>